from app import create_app
from app.setting.config import Config
app = create_app(Config)
from tornado.wsgi import WSGIContainer
from tornado.web import Application, FallbackHandler
from tornado.ioloop import IOLoop
from my_socket import ChatSocketHandler

if __name__ == '__main__':
    wsgi_app = WSGIContainer(app)
    application = Application([
        (r'/websocket', ChatSocketHandler),
        (r'.*', FallbackHandler, dict(fallback=wsgi_app))
    ])

    application.listen(5000)
    IOLoop.instance().start()